<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>魔方旋转</title>
		<style>
			*{
				margin:0;
				padding:0;
			}
			
			body{
				font-family: "微软雅黑";
				
			}
			
			body{
				perspective: 1000px;
				background-color:#00FFFF;
				
			}
			
			.box{
				width: 200px;
				margin: 200px auto;				
				transform-style: preserve-3d;
				transform:rotateX(-30deg) rotateY(30deg);
				position:relative;
				/* transition:all 50s; */
				animation: a 10s infinite;
				
			}
			
			@keyframes a{
				from{}
				to{transform:rotateX(-30deg) rotateY(3600deg);}
			}
			
			.box:hover{
				/* transform:rotateX(3600deg) rotateY(3600deg); */
			}
			
			.box div{
				width:200px;
				height:200px;
				text-align: center;
				line-height: 200px;
				font-size:50px;
				color:white;
				position: absolute;
			}
			
			
			.up{
				background-color:red;
				transform: rotateX(90deg) translateZ(100px);
				background-image: url(img/1.jpg);
				background-size:200px 200px;
			}
			
			.down{
				background-color:orange;
				transform: rotateX(-90deg) translateZ(100px);
				background-image: url(img/2.jpg);
				background-size:200px 200px;
			}
			
			.left{
				background-color:yellow;
				transform: rotateY(90deg) translateZ(-100px);
				background-image: url(img/3.jpg);
				background-size:200px 200px;
			}
			
			.right{
				background-color:green;
				transform: rotateY(90deg) translateZ(100px);
				background-image: url(img/4.jpg);
				background-size:200px 200px;
			}
			
			.front{
				background-color:cyan;
				transform: translateZ(100px);
				background-image: url(img/5.jpg);
				background-size:200px 200px;
			}
			
			.back{
				background-color:blue;
				transform: translateZ(-100px);
				background-image: url(img/6.jpg);
				background-size:200px 200px;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="up">1</div>
			<div class="down">2</div>
			<div class="left">3</div>
			<div class="right">4</div>
			<div class="front">5</div>
			<div class="back">6</div>
		</div>
	</body>
</html>
